//
//  ViewController.m
//  倒计时Button
//
//  Created by mac on 16/6/21.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ViewController.h"
#import "WDCountDownButton.h"
@interface ViewController ()
@property (nonatomic ,strong) WDCountDownButton *countDownBtn;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.countDownBtn];
    
}

-(WDCountDownButton *)countDownBtn{
    if (!_countDownBtn) {
        _countDownBtn = [[WDCountDownButton alloc]initWithFrame:CGRectMake(100, 100, 100, 50)];
        _countDownBtn.backgroundColor =[UIColor redColor];
        [_countDownBtn setSecond:10];
        [_countDownBtn addTarget:self action:@selector(startCountDown:) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return _countDownBtn;
}
-(void)startCountDown:(WDCountDownButton *)button{
    [button start];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
